package com.lch.designpattern.singleton.threadlocal;

/**
 * @author: liuchenhui
 * @create: 2019-04-17 22:20
 **/
public class ThreadLocalSingletonTest {
    public static void main(String[] args) {
        System.out.println(ThreadLocalSingleton.getInstance());
        System.out.println(ThreadLocalSingleton.getInstance());
        System.out.println(ThreadLocalSingleton.getInstance());
        System.out.println(ThreadLocalSingleton.getInstance());
        System.out.println(ThreadLocalSingleton.getInstance());

        Thread t1 = new Thread(new ThreadLocalSingletonRunable());
        Thread t2 = new Thread(new ThreadLocalSingletonRunable());

        t1.start();
        t2.start();
        System.out.println("End");
    }
}